//
//  EigthCell.m
//  房源、商铺、写字楼详情页
//
//  Created by MB__Lee on 2018/5/23.
//  Copyright © 2018年 MB__Lee. All rights reserved.
//

#import "EigthCell.h"

@interface EigthCell()<BMKMapViewDelegate>

@property (weak, nonatomic) IBOutlet UILabel *addressLabel;


@property(nonatomic,strong)BMKMapView *mapview;
@end

@implementation EigthCell
-(BMKMapView *)mapview{
    if (!_mapview) {
        _mapview = [[BMKMapView alloc] initWithFrame:CGRectMake(0, 30, SCREEN_WIDTH,180)];
        _mapview.delegate = self;
        _mapview.rotateEnabled = NO;
        _mapview.zoomLevel = 12;
        
    }
    return  _mapview;
}

- (void)awakeFromNib {
    [super awakeFromNib];
 
}
-(void)setModel:(MBFangDetailModel *)model{
    
    [super setModel:model];
    self.addressLabel.text = model.address;
    
//    [self addSubview:self.mapview];
//    [self setUserLocation];
    
}
-(void)setUserLocation{
    
    CLLocationDegrees lat = [self.model.lat doubleValue];
    CLLocationDegrees lng = [self.model.lng doubleValue];
    CLLocationCoordinate2D co2d = CLLocationCoordinate2DMake(lat, lng);
    [self.mapview setCenterCoordinate:co2d animated:YES];
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

#pragma mark -- BMKMapViewDelegate


@end
